<?php
return [
    'vendorPath' => dirname(dirname(__DIR__)) . '/vendor',
    'bootstrap' => ['comments', 'yee'],

    'language' => 'zh-CN',
    'sourceLanguage' => 'en-US',

    'components' => [
        'yee' => [
            'class' => 'yeesoft\Yee',
        ],
        'settings' => [
            'class' => 'yeesoft\components\Settings'
        ],
        'cache' => [
            'class' => 'yii\caching\FileCache',
        ],
        'user' => [
            'class' => 'yeesoft\components\User',
            'on afterLogin' => function ($event) {
                \yeesoft\models\UserVisitLog::newVisitor($event->identity->id);
            }
        ],

        'assetManager' => [
            'bundles' => [
                'yii\bootstrap\BootstrapAsset' => [
                    'sourcePath' => '@yeesoft/yee-theme/dist',
                     'css' => ['css/theme.min.css']
                ],
                'yii\bootstrap\BootstrapPluginAsset' => [
                    'sourcePath' => '@yeesoft/yee-theme/dist',
                     'js' => ['js/bootstrap.min.js',]
                ],
            ],
        ],


    ],

    'modules' => [
        'comments' => [
            'class' => 'yeesoft\comments\Comments',
            'userModel' => 'yeesoft\models\User',
            'userAvatar' => function ($user_id) {
                $user = yeesoft\models\User::findIdentity((int)$user_id);
                if ($user instanceof yeesoft\models\User) {
                    return $user->getAvatar();
                }
                return false;
            }
        ],


        'gii' => [
            'class' => 'yii\gii\Module',
            'allowedIPs' => ['*'],
            'generators' => [
                'yee-crud' => [
                    'class' => 'yeesoft\generator\crud\Generator',
                    'templates' => [
                        'default' => '@vendor/yeesoft/yii2-yee-generator/crud/yee-admin',
                    ]
                ],
            ],
        ],

        'eav' => [
            'class' => 'yeesoft\eav\EavModule',
        ],

        'block' => [
            'class' => 'yeesoft\block\BlockModule',
        ],

        'carousel' => [
            'class' => 'yeesoft\carousel\CarouselModule',
        ],

    ],







];
